<template>
  <div class="gl_px_15">
    <el-tabs v-model="peopleActive" type="card" @tab-click="handleClick">
      <el-tab-pane label="总排名" name="total">
        <total v-if="isFirst" />
      </el-tab-pane>
      <el-tab-pane label="竞技排名" name="sports">
        <sports v-if="isSecond" />
      </el-tab-pane>
      <el-tab-pane label="品势排名" name="poomsae">
        <poomsae v-if="isThird" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>
import total from './people/peoTotal';
import sports from './people/peoSports';
import poomsae from './people/peoPoomsae';

export default {
  name: 'PeopleRank',
  components: {
    total,
    sports,
    poomsae
  },
  data() {
    return {
      peopleActive: 'total',
      isFirst: true,
      isSecond: false,
      isThird: false
    };
  },
  methods: {
    handleClick(tab) {
      if (tab.name === 'total') {
        this.isFirst = true;
        this.isSecond = false;
        this.isThird = false;
      } else if (tab.name === 'sports') {
        this.isFirst = false;
        this.isSecond = true;
        this.isThird = false;
      } else if (tab.name === 'poomsae') {
        this.isFirst = false;
        this.isSecond = false;
        this.isThird = true;
      }
    }
  }
};
</script>
<style scoped>

</style>
